home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / dskut / disktime.zip / SECNDS.PAS < prev    next >
Pascal/Delphi Source File  |  1985-11-01  |  714b  |  31 lines

  1. Function Secnds:Real;
  2. {
  3.     This function returns the seconds past midnight as Real number
  4.  
  5.     Input        None
  6.  
  7.     Output       Secnds   Seconds past midnight as a Real number
  8.  
  9.     Strategy     (1)      Call DOS to get the time
  10.  
  11.                  (2)      Convert to floating point seconds past midnight
  12.  
  13. }
  14. Type
  15.     Result=Record
  16.                  Ax,Bx,Cx,Dx,Bp,Si,Di,Ds,Es,Flags:Integer;
  17.     End;
  18. Var
  19.    Sys:Result;
  20. Begin
  21.      SYS.AX:=$2C00          { AH is get time };
  22.      Intr($21,Sys);
  23.      If Odd(Sys.Flags) then
  24.      Begin
  25.           Writeln('Error getting the time');
  26.           Halt;
  27.      End;
  28.      Secnds:=Lo(SYS.DX)/100.+Hi(SYS.DX)+60.*(Lo(SYS.CX)+60.*Hi(SYS.CX));
  29. End;
  30.  
  31.